package com.tentative.competition.web.controller.schedule.client;

import com.tentative.competition.common.annotation.Anonymous;
import com.tentative.competition.common.core.controller.BaseController;
import com.tentative.competition.common.core.domain.AjaxResult;
import com.tentative.competition.schedule.service.ScheduleAttendInfoService;
import com.tentative.competition.schedule.service.ScheduleAwardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @auther: Smile Huang
 * @date: 2023/6/26 20:19
 * @desc:
 * @version: 2.0
 */
@Api(tags = "client-我要参赛")
@RestController
@RequestMapping("/client/want-attend")
public class WantAttendController extends BaseController {

    @Autowired
    private ScheduleAttendInfoService attendInfoService;

    @Autowired
    private ScheduleAwardService awardService;

    @ApiOperation("获取参赛配置公告")
    @GetMapping(value = "/configInfo/{scheduleId}")
    @Anonymous
    public AjaxResult getConfigInfo(@PathVariable("scheduleId") Long scheduleId) {
        return success(attendInfoService.getConfigInfo(scheduleId));
    }

    @ApiOperation("获取奖项配置")
    @GetMapping(value = "/awards/{scheduleId}")
    @Anonymous
    public AjaxResult getAwardsConfig(@PathVariable("scheduleId") Long scheduleId) {
        return success(awardService.getAwardsConfig(scheduleId));
    }
}
